{extend name="index_base" /}
      {block name="seo"}
        <title>修改评论|{$site_config['site_title']}|{$site_config['seo_title']}</title>
  
  
  <meta name="keywords" content="{$site_config['seo_keyword']}">
  <meta name="description" content="{$site_config['seo_description']}">
      {/block}
        {block name="css"}    
<link rel="stylesheet" href="__PUBLIC__/wangEditor/css/wangEditor.min.css">

<style type="text/css">
.wangEditor-menu-container .menu-item a {padding: 12px 0;}
.wangEditor-menu-container .menu-item {height: 37px;width: 37px;}
.wangEditor-menu-container .menu-group {padding: 0;}
.wangEditor-container {border: 1px solid #e6e6e6;}
</style>
   {/block}
           {block name="body"}
<div class="main layui-clear">
  <div class="fly-panel" pad20>
    <h2 class="page-title">修改评论</h2>
    <div class="layui-form layui-form-pane">
      <form method="post" enctype="multipart/form-data">
        <input type="hidden" name="id" value="{$tptc.id}">
		
		<div class="layui-form-item">
          <label for="L_title" class="layui-form-label">所属帖子</label>
          <div class="layui-input-block">
            <input type="text" value="{$tptc.title}" autocomplete="off" class="layui-input" disabled>
          </div>
        </div>
        <div class="layui-form-item layui-form-text">
          <div class="layui-input-block">
            <textarea id="textarea" name="content" lay-verify="layedit" style="height:400px;width: 100%;">{$tptc.content}</textarea>
          </div>
          <label for="L_content" class="layui-form-label" style="top: -2px;">内容</label>
        </div>
        <div class="layui-form-item">
          <button class="layui-btn" lay-submit="" lay-filter="comment_edit">立即发布</button>
        </div>
      </form>
    </div>
  </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/wangEditor/js/wangEditor.js"></script>
<script type="text/javascript">
var editor = new wangEditor('textarea');
$.get('{:url("index/getemotion")}',function (data){

	editor.config.uploadImgUrl = '{:url("index/forum/doUploadPic")}';
	editor.config.uploadImgFileName = 'FileName';
	var emotiondata;
	emotiondata=data;
	emotiondata = JSON.parse(emotiondata);
	editor.config.emotions =emotiondata;
	editor.config.menus = [
	                       'bold',
	                       'underline',
	                       'italic',
	                       'strikethrough',
	                       'forecolor',
	                       'link',
	                       'unlink',
	                       'emotion',
	                       'img',
	                      
	                       'insertcode',
	               		'fullscreen',
	                   ];
	editor.config.pasteText = false;
    editor.create();
});
   
</script>
<script>
layui.use('form', function(){
  var form = layui.form()
  ,jq = layui.jquery;

  form.on('submit(comment_edit)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("comment/edit",array("id"=>$tptc.id))}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("user/comment")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });

})
</script>
{/block}